#include <cstdio>

char queue[60];

int main(){
    freopen("in.txt","r",stdin);
    int num,sec;
    scanf("%d%d",&num,&sec);
    scanf("%s",queue);
    int i;
    i=num-1;
    while(i >= 0){
        if (queue[i] == 'B'){
            if(i+sec == num){
                queue[i]='G';
                queue[num-1]='B';
            }
            else if(i+sec < num){
                queue[i]='G';
                queue[i+sec]='B';
            }
            else
                queue[i]='B';
            i=i-sec-1;
        }
        else
            i--;
    }
    printf("%s",queue);
}
